#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define DAY 7
#define HOUR 24
void matrix_init(int a[], int n);
const int *find_largest(const int a[], int n);
int main(void)
{
    int temperatures[DAY][HOUR];
    matrix_init(temperatures[0], DAY * HOUR);
    for (int (*p)[HOUR] = temperatures; p < temperatures + DAY; p++) {
        for (int *q = p[0]; q < p[0] + HOUR; q++)
            printf("%3d ", *q);
        printf("\n");
    }
    printf("\n");
    for (int (*p)[HOUR] = temperatures; p < temperatures + DAY; p++) {
        const int *max = find_largest(p[0], HOUR);
        printf("%d\n", *max);
    }
    return 0;
}
void matrix_init(int a[], int n) {
    srand((unsigned) time(NULL));
    for (int i = 0; i < n; i++)
        a[i] = rand() % 100;
}
const int *find_largest(const int a[], int n) {
    const int *p = a;
    for (const int *q = a; q < a + n; q++)
        if (*p < *q)
            p = q;
    return p;
}
